package com.kly.pay.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.google.common.collect.Maps;
import com.kly.pay.db.dao.PPayTaskDao;
import com.kly.pay.db.entity.PPayTaskEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
* User: linqu
* Date: 2023-06-07
* Time: 20:03:06.868
*/

@Repository
public class PPayTaskDaoImpl extends AbstractBaseMapper<PPayTaskEntity> implements PPayTaskDao {


    /**
     * 查询需要发起回调任务的记录
     */
    @Override
    public List<PPayTaskEntity> queryProcessingTask() {
        final HashMap<Object, Object> params = Maps.newHashMap();
        return getSqlSession().selectList(this.getStatement("queryProcessingTask"), params);
    }

    /**
     * 查询最后一次回调记录
     */
    @Override
    public List<PPayTaskEntity> queryLatestTask(String payOrderNo) {
        return getSqlSession().selectOne(this.getStatement("queryLatestTask"), null);
    }
}